package com.kehutong.charge.util;

import com.coraframework.quartz.Job;
import com.coraframework.quartz.JobExecutionContext;
import com.coraframework.quartz.JobExecutionException;
import com.kehutong.charge.service.CommonService;
import com.kehutong.common.DoveClient;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.util.Ioc;

/**
 *  缴费定时任务
 */
public class ChargePenaltyJob implements Job {

    private static final Logger logger = LoggerFactory.getLogger(ChargePenaltyJob.class);

    private CommonService commonService;

    public ChargePenaltyJob() {
        this.commonService = Ioc.getInstance(CommonService.class);
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            logger.info("执行缴费定时任务开始！");
            //违约金定时生成
            commonService.updatePenaltyTask();
        } catch (Exception e) {
            logger.error("执行缴费定时任务异常！", e);
        }
    }

}
